<?php
namespace Pay\Controller;
use Common\Controller\HomebaseController;

class TestController extends HomebaseController {
	
	
	public function index() {
		$result = array(
			'out_trade_no' => '16120111282318567431231862347511',
			'total_fee' => '4',
			'transaction_id' => '1',
			'openid' => 'openid',
			'time_end' => '0',
		);
		$update_array = array(
				'order_no' => $result['out_trade_no'],
				'amount' => $result['total_fee'],
				'status' => 1,
				'trade_no' => $result['transaction_id'],
				'payfrom' => $result['openid'],
				'time' => $result['time_end'],
				'data' => array(
						'amount' => $result['total_fee'],
				),
		);
		$paystatus = D('PayStatus') -> updateStatus($update_array);
		
		//调起订单接口的更新订单状态
		$paystatus && \Mall\Lib\OrderLib::paySuccessOrderOperator($result['out_trade_no']);//传入order_id和order_no都可以
	}
	
}





